package com.xbongbong.paas.enums.bi;

import com.xbongbong.i18n.util.I18nMessageUtil;
import lombok.Getter;
import lombok.ToString;

import java.util.Arrays;
import java.util.List;

/**
 * @author zcp
 * @version v1.0
 * @since v1.0
 */
@Getter
@ToString
public enum DataSetOperateEnum {

    // 数据集操作
    ADD("add","enum.dataSetOperate.value.add", ""),

//    REFRESH("refresh","enum.dataSetOperate.value.refresh", "el-icon-refresh-right"),
    EDIT("edit","enum.dataSetOperate.value.edit", "el-icon-edit"),
    EDITABLE_RULE("editableRule", "enum.dataSetOperate.value.editable_rule", "el-icon-lock"),
    VISIBLE_SCOPE_RULE("visibleScopeRule", "enum.dataSetOperate.value.visible_scope_rule", "el-icon-view"),
    MORE("more", "enum.dataSetOperate.value.more", "el-icon-more"),


    RENAME("rename", "enum.dataSetOperate.value.rename", ""),
    EXECUTE_CONFIG("executeConfig", "enum.dataSetOperate.value.execute_config", ""),
    COPY("copy", "enum.dataSetOperate.value.copy", ""),
    DELETE("delete", "enum.dataSetOperate.value.delete", ""),
    ;

    private String attr;
    private String value;
    private String icon;

    DataSetOperateEnum(String attr, String value, String icon) {
        this.attr = attr;
        this.value = value;
        this.icon = icon;
    }

    public String getValue() {
        return I18nMessageUtil.getMessage(value);
    }

    /**
     * 获取直接展示到数据集操作栏的操作
     * @return java.util.List<com.xbongbong.paas.enums.bi.DataSetOperateEnum>
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static List<DataSetOperateEnum> getParentOperate(){
        return Arrays.asList(EDIT, EDITABLE_RULE, VISIBLE_SCOPE_RULE, MORE);
    }
    /**
     * 获取更多内的操作
     * @return java.util.List<com.xbongbong.paas.enums.bi.DataSetOperateEnum>
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static List<DataSetOperateEnum> getMoreOperate(){
        return Arrays.asList(RENAME, COPY, DELETE);
    }
    /**
     *
     * @param 
     * @return java.util.List<java.lang.String>
     * @throws 
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static List<String> checkNum(){
        return Arrays.asList(ADD.attr, COPY.attr);
    }
}
